package com.visikard.response;

import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;

import com.visikard.item.ItemCouponsBuilder;
import com.visikard.request.ParseRequesUtils;

public class GetCouponResponse extends BaseResponse {
	private List<ItemCouponsBuilder> listCoupons;

	public List<ItemCouponsBuilder> getListCoupons() {
		return listCoupons;
	}

	public void setListCoupons(List<ItemCouponsBuilder> listCoupons) {
		this.listCoupons = listCoupons;
	}

	@Override
	public void extractDataFromServer(String response) throws JSONException {
		super.extractDataFromServer(response);
		// response OK
		if (errorCode == SUCCESS) {
			JSONArray jsArr = getDataJArray(response);
			listCoupons = ParseRequesUtils.parserListCouponsBuilder(jsArr.toString());
		}
	}

}
